<template>
  <div class="app-container">
    <!--        <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
              <el-form-item label="排放口名称" prop="exoName">
                <el-input
                  v-model="queryParams.exoName"
                  placeholder="请输入排放口名称"
                  clearable
                  size="small"
                  @keyup.enter.native="handleQuery"
                />
              </el-form-item>
              <el-form-item label="污染物种类" prop="exoWasteType">
                <el-select v-model="queryParams.exoWasteType" placeholder="请选择污染物种类" clearable size="small">
                  <el-option label="请选择字典生成" value="" />
                </el-select>
              </el-form-item>
              <el-form-item label="排放类型" prop="exoEmissionType">
                <el-select v-model="queryParams.exoEmissionType" placeholder="请选择排放类型" clearable size="small">
                  <el-option label="请选择字典生成" value="" />
                </el-select>
              </el-form-item>
              <el-form-item label="有无烟囱(0代表存在 1代表不存在)" prop="exoHasChimney">
                <el-input
                  v-model="queryParams.exoHasChimney"
                  placeholder="请输入有无烟囱(0代表存在 1代表不存在)"
                  clearable
                  size="small"
                  @keyup.enter.native="handleQuery"
                />
              </el-form-item>
              <el-form-item label="烟囱高度" prop="exoChimneyHigh">
                <el-input
                  v-model="queryParams.exoChimneyHigh"
                  placeholder="请输入烟囱高度"
                  clearable
                  size="small"
                  @keyup.enter.native="handleQuery"
                />
              </el-form-item>
              <el-form-item label="烟囱尺寸" prop="exoChimneyWidth">
                <el-input
                  v-model="queryParams.exoChimneyWidth"
                  placeholder="请输入烟囱尺寸"
                  clearable
                  size="small"
                  @keyup.enter.native="handleQuery"
                />
              </el-form-item>
              <el-form-item label="经度" prop="exoLg">
                <el-input
                  v-model="queryParams.exoLg"
                  placeholder="请输入经度"
                  clearable
                  size="small"
                  @keyup.enter.native="handleQuery"
                />
              </el-form-item>
              <el-form-item label="纬度" prop="exoLt">
                <el-input
                  v-model="queryParams.exoLt"
                  placeholder="请输入纬度"
                  clearable
                  size="small"
                  @keyup.enter.native="handleQuery"
                />
              </el-form-item>
              <el-form-item label="照片" prop="exoPicture">
                <el-input
                  v-model="queryParams.exoPicture"
                  placeholder="请输入照片"
                  clearable
                  size="small"
                  @keyup.enter.native="handleQuery"
                />
              </el-form-item>
              <el-form-item label="浓度" prop="exoConcentration">
                <el-input
                  v-model="queryParams.exoConcentration"
                  placeholder="请输入浓度"
                  clearable
                  size="small"
                  @keyup.enter.native="handleQuery"
                />
              </el-form-item>
              <el-form-item label="总量" prop="exoTotal">
                <el-input
                  v-model="queryParams.exoTotal"
                  placeholder="请输入总量"
                  clearable
                  size="small"
                  @keyup.enter.native="handleQuery"
                />
              </el-form-item>
              <el-form-item label="当前环境空气质量标准" prop="exoEnvAirStandard">
                <el-input
                  v-model="queryParams.exoEnvAirStandard"
                  placeholder="请输入当前环境空气质量标准"
                  clearable
                  size="small"
                  @keyup.enter.native="handleQuery"
                />
              </el-form-item>
              <el-form-item label="是否有在线监测设施(0代表存在 1代表不存在)" prop="exoHasOnlineFacility">
                <el-input
                  v-model="queryParams.exoHasOnlineFacility"
                  placeholder="请输入是否有在线监测设施(0代表存在 1代表不存在)"
                  clearable
                  size="small"
                  @keyup.enter.native="handleQuery"
                />
              </el-form-item>
              <el-form-item label="监督性监测报告" prop="exoReport">
                <el-input
                  v-model="queryParams.exoReport"
                  placeholder="请输入监督性监测报告"
                  clearable
                  size="small"
                  @keyup.enter.native="handleQuery"
                />
              </el-form-item>
              <el-form-item label="环境监察记录" prop="exoRecord">
                <el-input
                  v-model="queryParams.exoRecord"
                  placeholder="请输入环境监察记录"
                  clearable
                  size="small"
                  @keyup.enter.native="handleQuery"
                />
              </el-form-item>
              <el-form-item label="规范化排口(0代表存在 1代表不存在)" prop="exoHasNormalization">
                <el-input
                  v-model="queryParams.exoHasNormalization"
                  placeholder="请输入规范化排口(0代表存在 1代表不存在)"
                  clearable
                  size="small"
                  @keyup.enter.native="handleQuery"
                />
              </el-form-item>
              <el-form-item label="规范化名称" prop="exoNzName">
                <el-input
                  v-model="queryParams.exoNzName"
                  placeholder="请输入规范化名称"
                  clearable
                  size="small"
                  @keyup.enter.native="handleQuery"
                />
              </el-form-item>
              <el-form-item label="编号" prop="exoNzCode">
                <el-input
                  v-model="queryParams.exoNzCode"
                  placeholder="请输入编号"
                  clearable
                  size="small"
                  @keyup.enter.native="handleQuery"
                />
              </el-form-item>
              <el-form-item label="排口截面积" prop="exoLong">
                <el-input
                  v-model="queryParams.exoLong"
                  placeholder="请输入排口截面积"
                  clearable
                  size="small"
                  @keyup.enter.native="handleQuery"
                />
              </el-form-item>
              <el-form-item label="废气治理设施名称" prop="etfName">
                <el-input
                  v-model="queryParams.etfName"
                  placeholder="请输入废气治理设施名称"
                  clearable
                  size="small"
                  @keyup.enter.native="handleQuery"
                />
              </el-form-item>
              <el-form-item>
                <el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">搜索</el-button>
                <el-button icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
              </el-form-item>
            </el-form>-->

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          v-hasPermi="['pollutant:atmosphere:add']"
          icon="el-icon-plus"
          plain
          size="small"
          type="primary"
          @click="handleAdd"
        >新增
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          v-hasPermi="['pollutant:atmosphere:edit']"
          :disabled="single"
          icon="el-icon-edit"
          plain
          size="small"
          type="success"
          @click="handleUpdate"
        >修改
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          v-hasPermi="['pollutant:atmosphere:remove']"
          :disabled="multiple"
          icon="el-icon-delete"
          plain
          size="small"
          type="danger"
          @click="handleDelete"
        >删除
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          v-hasPermi="['pollutant:atmosphere:export']"
          :loading="exportLoading"
          icon="el-icon-download"
          plain
          size="small"
          type="warning"
          @click="handleExport"
        >导出
        </el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="atmosphereList" @selection-change="handleSelectionChange">
      <el-table-column align="center" type="selection" width="55"/>
      <el-table-column align="center" label="排放口名称" prop="exoName"/>
      <!--      <el-table-column align="center" label="污染物种类" prop="exoWasteType"/>-->
      <el-table-column align="center" label="排放类型" prop="exoEmissionType"/>
      <!--      <el-table-column align="center" label="有无烟囱(0代表存在 1代表不存在)" prop="exoHasChimney"/>-->
      <!--      <el-table-column align="center" label="烟囱高度" prop="exoChimneyHigh"/>-->
      <!--      <el-table-column align="center" label="烟囱尺寸" prop="exoChimneyWidth"/>-->
      <!--      <el-table-column align="center" label="经度" prop="exoLg"/>-->
      <!--      <el-table-column align="center" label="纬度" prop="exoLt"/>-->
      <!--      <el-table-column align="center" label="照片" prop="exoPicture"/>-->
      <!--      <el-table-column align="center" label="浓度" prop="exoConcentration"/>-->
<!--      <el-table-column align="center" label="总量" prop="exoTotal"/>-->
      <!--      <el-table-column align="center" label="当前环境空气质量标准" prop="exoEnvAirStandard"/>-->
      <!--      <el-table-column align="center" label="是否有在线监测设施(0代表存在 1代表不存在)" prop="exoHasOnlineFacility"/>-->
      <el-table-column align="center" label="监督性监测报告" prop="exoReport">
        <template slot-scope="scope" v-if="scope.row.exoReport">
          <a :href="`${baseUrl}${scope.row.exoReport}`" target="_blank"
             class="buttonText">{{ scope.row.exoReport.toString().substring(scope.row.exoReport.lastIndexOf("/") + 1) }}</a>
        </template>
      </el-table-column>
      <el-table-column align="center" label="环境监察记录" prop="exoRecord">
        <template slot-scope="scope" v-if="scope.row.exoRecord">
          <a :href="`${baseUrl}${scope.row.exoRecord}`" target="_blank"
             class="buttonText">{{ scope.row.exoRecord.toString().substring(scope.row.exoRecord.lastIndexOf("/") + 1) }}</a>
        </template>
      </el-table-column>
      <el-table-column align="center" label="规范化排口" prop="exoHasNormalization"/>
      <!--      <el-table-column align="center" label="规范化名称" prop="exoNzName"/>-->
      <!--      <el-table-column align="center" label="编号" prop="exoNzCode"/>-->
      <!--      <el-table-column align="center" label="排口截面积" prop="exoLong"/>-->
      <!--      <el-table-column align="center" label="废气治理设施名称" prop="etfName"/>-->
      <!--      <el-table-column align="center" label="备注" prop="remark"/>-->
      <el-table-column align="center" class-name="small-padding fixed-width" label="操作">
        <template slot-scope="scope">
          <el-button
            v-hasPermi="['pollutant:atmosphere:edit']"
            size="small"
            @click="handleUpdate(scope.row)"
          >修改
          </el-button>
          <el-button
            v-hasPermi="['pollutant:atmosphere:remove']"
            size="small"
            @click="handleDelete(scope.row)"
          >删除
          </el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :limit.sync="queryParams.pageSize"
      :page.sync="queryParams.pageNum"
      :total="total"
      @pagination="getList"
    />

    <!-- 添加或修改废气排放对话框 -->
    <el-dialog :title="title" :visible.sync="open" append-to-body width="60%">
      <el-form ref="form" :model="form" :rules="rules" class="clearfix  m-f-a-i" label-width="190px"
               style="padding-left: 20px; padding-right: 20px">
        <div class="content-left" style="width: 45%">
          <el-form-item label="排放口名称" prop="exoName">
            <el-input v-model="form.exoName" placeholder="请输入排放口名称" style="width: 200px;"/>
          </el-form-item>
          <!--          <el-form-item label="污染物种类" prop="exoWasteType">-->
          <!--            <el-select v-model="form.exoWasteType" placeholder="请选择污染物种类" style="width: 100%">-->
          <!--              <el-option label="请选择字典生成" value=""/>-->
          <!--            </el-select>-->
          <!--          </el-form-item>-->
          <el-form-item label="排放类型">
            <div style="width: 200px;">
              <el-select v-model="exoIndex" clearable placeholder="请选择" style="width: 100%;"
                         @change="exoChange">
                <el-option v-for="item in exo" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </el-select>
            </div>
          </el-form-item>


<!--          <el-form-item label="浓度" prop="exoConcentration">
            <el-input v-model="form.exoConcentration" placeholder="请输入浓度"/>
          </el-form-item>
          <el-form-item label="总量" prop="exoTotal">
            <el-input v-model="form.exoTotal" placeholder="请输入总量"/>
          </el-form-item>-->
<!--          <el-form-item label="空气质量标准" prop="exoEnvAirStandard">
            <el-input v-model="form.exoEnvAirStandard" placeholder="请输入当前环境空气质量标准"/>
          </el-form-item>-->
          <el-form-item label="经纬度">
                <div style="display: flex;width: 500px;">
                  <div style="width: 100px;">
                    <el-input v-model="form.exoLg" placeholder="请输入经度"/>
                  </div>
                  <div style="width: 100px;">
                    <el-input v-model="form.exoLt" placeholder="请输入纬度"/>
                  </div>
                </div>
          </el-form-item>
          <el-form-item label="是否有在线监测" prop="exoHasOnlineFacility">
            <!--              <el-input v-model="form.exoHasOnlineFacility" placeholder="请输入是否有在线监测设施(0代表存在 1代表不存在)"/>-->
            <div style="width: 200px;">
              <el-select v-model="zxIndex" clearable placeholder="请选择" style="width: 100%;"
                         @change="zxChange">
                <el-option v-for="item in zx" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </el-select>
            </div>
          </el-form-item>
          <el-form-item label="烟囱" prop="exoHasChimney">
            <div style="width: 200px;">
              <el-select v-model="ycIndex" clearable placeholder="请选择" style="width: 100%;"
                         @change="ycChange">
                <el-option v-for="item in yc" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </el-select>
            </div>
          </el-form-item>
          <div v-show="yantong">
            <el-form-item label="烟囱高度" prop="exoChimneyHigh">
            <el-input v-model="form.exoChimneyHigh" placeholder="请输入烟囱高度" style="width: 200px;"/>
            </el-form-item>
            <el-form-item label="烟囱尺寸" prop="exoChimneyWidth">
            <el-input v-model="form.exoChimneyWidth" placeholder="请输入烟囱尺寸" style="width: 200px;"/>
            </el-form-item>
          </div>
        </div>

        <div class="content-left"  style="margin-left: 286px;">

          <el-form-item label="监督性监测报告" prop="exoReport">
            <FileUpload v-model="form.exoReport"/>
          </el-form-item>
          <el-form-item label="环境监察记录" prop="exoRecord">
            <FileUpload v-model="form.exoRecord"/>
          </el-form-item>


          <el-form-item label="规范化排口" prop="exoHasNormalization">
            <div style="width: 100%;">
              <el-select v-model="pkIndex" clearable placeholder="请选择" style="width: 100%;"
                         @change="pkChange">
                <el-option v-for="item in pk" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </el-select>
            </div>
          </el-form-item>
          <div v-show="isShow">
          <el-form-item label="规范化名称" prop="exoNzName">
            <el-input v-model="form.exoNzName" placeholder="请输入规范化名称"/>
          </el-form-item>
          <el-form-item label="编号" prop="exoNzCode">
            <el-input v-model="form.exoNzCode" placeholder="请输入编号"/>
          </el-form-item>
          <el-form-item label="排口截面积" prop="exoLong">
            <el-input v-model="form.exoLong" placeholder="请输入排口截面积"/>
          </el-form-item>
          </div>
<!--                    <div class="line">
                      <el-form-item label="废气治理设施名称" prop="etfName">
                        <el-input v-model="form.etfName" placeholder="请输入废气治理设施名称"/>
                      </el-form-item>
                    </div>-->
          <el-form-item label="照片" prop="exoPicture">
            <ImageUpload v-model="form.exoPicture" />
          </el-form-item>
        </div>
      </el-form>
      <div class="more-title">污染物排放标准</div>
      <div  style="display: flex; align-items: center"  v-for="(item,index) in itemPerson">
        <div style="width: 80%; padding-left: 30px;" >
          <div   class="fuliao "  style="border: none">
            <div class="ful-input">
              <div class="ful-input-box">
                <span>污染物排放执行标准 </span>
                <el-input  style="height: 30px;"  v-model="item.x1"></el-input>
              </div>
              <div class="ful-input-box">
                <span>主要污染物</span>
                <el-input  style="height: 30px;" v-model="item.x2"></el-input>
              </div>
              <div class="ful-input-box">
                <span>排放浓度限值(千克)</span>
                <el-input  style="height: 30px;"  v-model="item.x3"></el-input>
              </div>
              <div class="ful-input-box">
                <span>排放总量限值(吨)</span>
                <el-input  style="height: 30px;"  v-model="item.x4"></el-input>
              </div>
            </div>
          </div>
        </div>
        <div  class="ful-btn">
          <el-button type="primary" @click="addMore(index)" style="height: 40px; line-height: 40px;padding: 0;padding-left: 20px; padding-right: 20px">添加</el-button>
          <el-button type="danger" @click="removeMore(index)"  style="height: 40px; line-height: 40px;padding: 0;padding-left: 20px; padding-right: 20px">删除</el-button>
        </div>
      </div>

      <div slot="footer" class="dialog-footer tianjie_button" style="text-align: center">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {
  addAtmosphere,
  delAtmosphere,
  exportAtmosphere,
  getAtmosphere,
  listAtmosphere,
  updateAtmosphere
} from "@/api/pollutant/atmosphere";
import {getToken} from "@/utils/auth";
import {InfoItem} from "@/api/enterprise/info";
import {isNotMUstTwoPoint,validatePhoneTwo,validateIdNo,validateEMail} from "@/api/validate/validate";


export default {
  name: "Atmosphere",
  data() {
    return {
      baseUrl: process.env.VUE_APP_BASE_API,
      isShow: false,
      yantong:false,
      itemPerson:[
        {
          x1:"",
          x2:"",
          x3:"",
          x4:"",
        }
      ],
      zx: [
        {
          value: '0',
          label: '有'
        },
        {
          value: '1',
          label: '无'
        }
      ],
      zxIndex: '1',
      pk: [
        {
          value: '0',
          label: '是'
        },
        {
          value: '1',
          label: '否'
        }
      ],
      pkIndex: '1',
      yc: [
        {
          value: '0',
          label: '有'
        },
        {
          value: '1',
          label: '无'
        }
      ],
      ycIndex: '1',
      exo: [
        {
          value: '0',
          label: '有组织排放'
        },
        {
          value: '1',
          label: '无组织排放'
        }
      ],
      exoIndex: '0',
      // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 废气排放表格数据
      atmosphereList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        exoName: null,
        exoWasteType: null,
        exoEmissionType: null,
        exoHasChimney: null,
        exoChimneyHigh: null,
        exoChimneyWidth: null,
        exoLg: null,
        exoLt: null,
        exoPicture: null,
        exoConcentration: null,
        exoTotal: null,
        exoEnvAirStandard: null,
        exoHasOnlineFacility: null,
        exoReport: null,
        exoRecord: null,
        exoHasNormalization: null,
        exoNzName: null,
        exoNzCode: null,
        exoLong: null,
        etfName: null,
        epId:null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        exoName: [
          {required: true, message: "排放口名称不能为空", trigger: "blur"}
        ],
        exoTotal: [
          {validator:isNotMUstTwoPoint, trigger: "blur"}
        ]
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    btnMore(){
      var arrx1=[];
      var arrx2=[];
      var arrx3=[];
      var arrx4=[];
      var stautus;
      this.itemPerson.map(function(item){
        if(item.x1 && item.x2 && item.x3 && item.x4 ){
          arrx1.push(item.x1);
          arrx2.push(item.x2);
          arrx3.push(item.x3);
          arrx4.push(item.x4);
          stautus=true;
        }else{
          stautus=false;
        }
      })


      this.form.exoEnvAirStandard=arrx1.join(',') //污染物排放执行标准
      this.form.exoWasteType=arrx2.join(','); //主要污染物
      this.form.exoConcentration=arrx3.join(','); //排放浓度限值
      this.form.exoTotal=arrx4.join(','); //排放总量限值
      return stautus;
    },
    addMore(index){
      this.itemPerson.push( {
        x1:"",
        x2:"",
        x3:"",
        x4:"",
      })
    },
    removeMore(index){
      if( this.itemPerson.length<=1){
        this.msgError("至少保留一行");
        return;
      }
      this.itemPerson.splice(index, 1)
    },
    exoChange(e) {
      this.form.exoEmissionType = e;
    },
    zxChange(e) {
      this.form.exoHasOnlineFacility = e;
    },
    pkChange(e) {
      this.form.exoHasNormalization = e;
      if(e == 0){
        this.isShow = true;
      }

      if(e == 1){
        this.isShow = false;
      }
    },
    ycChange(e) {
      this.form.exoHasChimney = e;
      if(e == 0){
        this.yantong = true;
      }

      if(e == 1){
        this.yantong = false;
      }
    },
    /** 查询废气排放列表 */
    getList() {
      this.loading = true;
      const username = this.$store.state.user.name;
      InfoItem(username).then(res => {
        if (res.hasOwnProperty("data")) {
          this.queryParams.epId = res.data.epId;
          listAtmosphere(this.queryParams).then(response => {
            this.atmosphereList = response.rows;
            this.total = response.total;
            this.loading = false;
          });
        }
      })
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        exoId: null,
        exoName: null,
        exoWasteType: null,
        exoEmissionType: null,
        exoHasChimney: null,
        exoChimneyHigh: null,
        exoChimneyWidth: null,
        exoLg: null,
        exoLt: null,
        exoPicture: null,
        exoConcentration: null,
        exoTotal: null,
        exoEnvAirStandard: null,
        exoHasOnlineFacility: null,
        exoReport: null,
        exoRecord: null,
        exoHasNormalization: null,
        exoNzName: null,
        exoNzCode: null,
        exoLong: null,
        etfName: null,
        delFlag: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        remark: null,
        epId:null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.exoId)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;

      this.title = "添加废气排放";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const exoId = row.exoId || this.ids
      getAtmosphere(exoId).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改废气排放";
        var arr1=this.form.exoEnvAirStandard.split(',')
        var arr2= this.form.exoWasteType.split(',')
        var arr3= this.form.exoConcentration.split(',')
        var arr4= this.form.exoTotal.split(',')
        var arrAll=[];
        for(var i=0;i<arr1.length;i++){
          arrAll.push(
            {
              x1:arr1[i],
              x2:arr2[i],
              x3:arr3[i],
              x4:arr4[i],

            }
          )
        }
        this.itemPerson=arrAll;
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.exoId != null) {
            if(!this.btnMore()) {
              this.msgError("请填写完整的信息");
            }else {
              updateAtmosphere(this.form).then(response => {
                this.msgSuccess("修改成功");
                this.open = false;
                this.getList();
              });
            }
          } else {
            const username = this.$store.state.user.name;
            InfoItem(username).then(res => {
              if (res.hasOwnProperty("data")) {
                this.form.epId = res.data.epId;
              }
              if(!this.btnMore()) {
                this.msgError("请填写完整的信息");
              }else {
                addAtmosphere(this.form).then(response => {
                  this.msgSuccess("新增成功");
                  this.open = false;
                  this.getList();
                });
              }
            })
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const exoIds = row.exoId || this.ids;
      this.$confirm('是否确认删除废气排放编号为"' + exoIds + '"的数据项?', "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(function () {
        return delAtmosphere(exoIds);
      }).then(() => {
        this.getList();
        this.msgSuccess("删除成功");
      }).catch(() => {
      });
    },
    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams;
      this.$confirm('是否确认导出所有废气排放数据项?', "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        this.exportLoading = true;
        return exportAtmosphere(queryParams);
      }).then(response => {
        this.download(response.msg);
        this.exportLoading = false;
      }).catch(() => {
      });
    }
  }
};
</script>
<style scoped>
.app-container-atmosphere {
  padding-left: 60px;
  padding-right: 60px;
}
/deep/ .el-upload--picture-card{
  height: 120px;
}
/deep/ .el-upload-list--picture-card .el-upload-list__item{
  margin: 0;
  margin-left: 20px;
  height: 107px;
}
.more-title{
  text-align: center;
  height: 40px;
  line-height: 40px;
  color: #333;
  font-weight: bold;
  border-bottom: 1px solid #ccc;
}
.fuliao{
  width: 100%;
  height: 30px;
  padding-left: 46px;
  font-size: 12px;
  margin: 0 auto;
  /*border-top: 1px solid #ccc;*/
  margin-bottom: 10px;
  margin-top: 14px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  /*padding-top: 32px;*/
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  justify-content: space-between;
}
.ful-input{
  width: 100%;
  display: flex;

  align-items: center;
  /*justify-content: space-around;*/
}
.ful-title{
  font-size:16px;
  color: #333;
  width: 50%;
  text-align: center;
  font-weight: 700;
}
.fuliao/deep/.el-input__inner{
  width: 100%;
  height: 30px !important;

}
.content-left {
  width: 30% !important;
  float: left;
}
.ful-btn{
  width: 20%;
  margin-left: 10px;
}
.ful-input-box{
  width: 28%;
  font-weight: bold;

  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ful-input-box span{
  text-align: right;
  width: 150%;
  color: #333;
  display: inline-block;
  padding-right: 10px;
}
.fuliao/deep/.el-input__inner{
  width: 100%;
  height: 30px !important;
}
</style>
